package com.company.dcm.server.protocol.enums;

import lombok.Getter;

/**
 * @Author: 王泽同
 * @Description:
 */
@Getter
public enum ProtocolTaskOptionEnum {
    //生成对应的操作指令
    EQUIPMENT_MODEL("EQUIPMENT_MODEL",1,1),
    BATTERY_STATUS("BATTERY_STATUS",1,2),
    EQUIPMENT_SERIAL("EQUIPMENT_SERIAL",1,3),
    FIRMWARE_VERSION("FIRMWARE_VERSION",1,4),
    DEVICE_STATUS("DEVICE_STATUS",1,5),
    USER_AUTHENTICATION("USER_AUTHENTICATION",1,6),

    SET_RT_DEVICE_INFO("setRT_DeviceInfo",1,51),
    EDIT_OR_ADD_RF_ClothSheet("editOrAddRF_ClothSheet", 1,52),
    ADD_RF_ClothSheetDetail("addRF_ClothSheetDetail", 1,53),
    ClothSheetDetail("ClothSheetDetail",1,59),

    GET_CLOTH_INFO("GET_CLOTH_INFO",1,56),
    SEND_CLOTH_INFO("SEND_CLOTH_INFO",1,57),

    CHECK_UPDATE("CHECK_UPDATE",1,100),
    DOWNLOAD_FILE("DOWNLOAD_FILE",1,65),

    NOTICE_OTA_UPDATED("noticeOtaUpdate",1,7),
    OTA_UPDATE_SUCCESS("otaUpdateSuccess",1,8),
    GET_MES_CAMERA("GET_MES_CAMERA",1,58),


    GET_MES_SWITCH_DETECTION("GET_MES_SWITCH_DETECTION",4,51),
    SEND_EQUIPMENT_SERIAL("SEND_EQUIPMENT_SERIAL",4,54),

    GET_MES_IMAGE_REPORT("GET_IMAGE_REPORT",4,63),


    ADJUST_CAMERA_PARAMETERS("ADJUST_CAMERA_PARAMETERS",1,60),

    DONOT("doNot",1,999);

    private final String text;
    private final int type;
    private final int value;


    ProtocolTaskOptionEnum(String text, int type,int value){
        this.text = text;
        this.type = type;
        this.value = value;
    }

    /**
     * 根据value获取枚举值
     * @param value
     * @return
     */
    public static ProtocolTaskOptionEnum getEnumByTypeAndValue(int type,int value){
        for (ProtocolTaskOptionEnum anEnum : ProtocolTaskOptionEnum.values())
            if (anEnum.type==type&&anEnum.value == value){
                return anEnum;
            }
        return null;
    }
}
